<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/includeTaglib.jsp" %>

<table class="globalText" border="0" cellpadding="0" cellspacing="2">
	<tr>
		<td><input type="button" class="btnStyle" value="添加促销员" onclick="var a=window.showModalDialog('<c:url value="/project/salesPromoterList.html"/>?projectId=${projectId}',window,'status:no;resizable:no;directories:no;help:no;scroll:no;dialogWidth=800px;dialogHeight=450px;dialogLeft:500px;dialogTop:300px;');
																			
																			"></td>
	</tr>
</table>
<div id="salesPromoterListData" class="pageDiv">
</div>

<form id="salesPromoterListForm" style="display: none;" >
	<input type="hidden" name="projectId" value="${projectId}" />
</form>


<form action="<c:url value="/project/addSalesPromoterToProject.html" />" id="salesPromoterListFormForm" target="tempFrame" method="post" >
	<input type="hidden" name="projectId" value="${projectId}" />
	<input type="hidden" name="salesPromoterList" id="salesPromoterList" />
</form>

<script>
	function addSalesPromoterToProject(obj){
		var salesPromoterList="";
		for(var i in obj){
			salesPromoterList+=obj[i]+",";
		}
		$("#salesPromoterList").val(salesPromoterList);
		$("#salesPromoterListFormForm").submit();
	}
	
	function submitCallbackSuccess(obj){
		listDefaultPageAjax('salesPromoterListData','salesPromoterListForm','<c:url value="/project/projectSalesPromoterList.html" />');
	}
	function submitCallbackFailed(obj){
		listDefaultPageAjax('salesPromoterListData','salesPromoterListForm','<c:url value="/project/projectSalesPromoterList.html" />');
	}
	
	function chooseSalesPromoterCallBack(obj){
		addSalesPromoterToProject(obj);
	}
</script>
<script>
	listDefaultPageAjax('salesPromoterListData','salesPromoterListForm','<c:url value="/project/projectSalesPromoterList.html" />');
</script>
